<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <script src="../jquery/jquery-3.2.1.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="../css/bootstrap.css">

</head>
<body>


<div class="container">

    <pre>
        <h3>基本用法</h3>
        <h4>
            ①使用class="dropdown"的容器包裹整个下拉菜单----<div class="dropdown"></div>

            ②使用一个button按钮作为一个父级菜单，并且定义一个class="dropdown-toggle"，
            给button添加一个自定义属性data-toggle="dropdown"，这里是相对固定的
            <button class="btn btn-default dropdown-toggle" data-toggle="dropdown" type="button"></button>

            ③在button按钮同级添加一个元素，并且添加class="dropdown-menu".

            完整实例如下：
        </h4>
    </pre>
    <div class="dropdown">
        <button class="dropdown-toggle" data-toggle="dropdown">下拉菜单</button>
        <ul class="dropdown-menu">
            <li><a href="javaScript:">JavaScript</a></li>
            <li><a href="javaScript:">Css3</a></li>
            <li><a href="javaScript:">HTML5</a></li>
            <li><a href="javaScript:">JQuery</a></li>
        </ul>
    </div>

    <h3>分割线</h3>
    <div class="dropdown">
        <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
            下拉菜单
            <span class="caret"></span>
        </button>


        <ul class="dropdown-menu">
            <li><a href="javaScript:">CSS3</a></li>
            <li><a href="javaScript:">HTML5</a></li>
            <li class="divider"></li>
            <li><a href="javaScript:">JavaScript</a></li>
            <li><a href="javaScript:">JQuery</a></li>
        </ul>
    </div>
    <h3>
        对齐方式
    </h3>
      <div class="row">
          <div class="col-lg-1">
              <div class="dropdown">
                  <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                      下拉菜单
                      <span class="caret"></span>
                  </button>
                  <ul class="dropdown-menu">
                      <li class="dropdown-header">标题</li>
                      <li><a href="javaScript:">CSS3</a></li>
                      <li><a href="javaScript:">HTML5</a></li>
                  </ul>
              </div>
          </div>
          <div class="col-lg-1">
              <div class="dropdown">
                  <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                      下拉菜单
                      <span class="caret"></span>
                  </button>
                  <ul class="dropdown-menu ">
                      <li class="dropdown-header">标题</li>
                      <li><a href="javaScript:">CSS3</a></li>
                      <li><a href="javaScript:">HTML5</a></li>
                  </ul>
              </div>
          </div>
          <div class="col-lg-1">
              <div class="dropdown">
                  <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                      下拉菜单
                      <span class="caret"></span>
                  </button>
                  <ul class="dropdown-menu">
                      <li class="dropdown-header">标题</li>
                      <li><a href="javaScript:">CSS3</a></li>
                      <li><a href="javaScript:">HTML5</a></li>
                  </ul>
              </div>
          </div>
      </div>

    <h3>菜单状态</h3>
    <pre>
        <h4>
            下拉菜单默认有两种
            鼠标悬停(hover)
            焦点状态(focus)
        </h4>
    </pre>
    <div class="row">
        <div class="col-lg-3">
            <div class="dropdown">
                <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
                    下拉菜单
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <li class="dropdown-header">标题</li>
                    <li class="active"><a href="javaScript:">javaScript</a></li>
                    <li class="focus"><a href="javaScript:">HTML5</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
</body>
</html>